package game.model.converter;

import common.model.po.GBuilding;
import game.model.request.SaveBuildingRequest;
import game.model.vo.BuildingDetailVo;

/**
 * @author 米泽鹏
 * @since 2022-2-28 上午 2:09
 */
public class GBuildingConverter {

	public static GBuilding requestToPo(SaveBuildingRequest saveBuildingRequest) {
		if (saveBuildingRequest == null) {
			return null;
		}
		GBuilding gBuilding = new GBuilding();
		gBuilding.setBuildingName(saveBuildingRequest.getBuildingName());
		gBuilding.setDescription(saveBuildingRequest.getDescription());
		gBuilding.setSort(saveBuildingRequest.getSort());
		gBuilding.setCustomSort(saveBuildingRequest.getCustomSort());
		gBuilding.setClassificationId(saveBuildingRequest.getClassificationId());
		gBuilding.setBeltEntrancesCount(saveBuildingRequest.getBeltEntrancesCount());
		gBuilding.setPipeInletsCount(saveBuildingRequest.getPipeInletsCount());
		gBuilding.setBeltOutletsCount(saveBuildingRequest.getBeltOutletsCount());
		gBuilding.setPipeOutletsCount(saveBuildingRequest.getPipeOutletsCount());
		gBuilding.setPipeHoleCount(saveBuildingRequest.getPipeHoleCount());
		gBuilding.setProductive(saveBuildingRequest.getProductive());
		gBuilding.setNeedPower(saveBuildingRequest.getNeedPower());
		gBuilding.setPower(saveBuildingRequest.getPower());
		gBuilding.setOverclockable(saveBuildingRequest.getOverclockable());
		gBuilding.setIsVehicle(saveBuildingRequest.getIsVehicle());
		gBuilding.setIsRequireLandform(saveBuildingRequest.getIsRequireLandform());
		gBuilding.setImage(saveBuildingRequest.getImage());
		gBuilding.setId(saveBuildingRequest.getId());
		gBuilding.setCreateTime(saveBuildingRequest.getCreateTime());
		gBuilding.setUpdateTime(saveBuildingRequest.getUpdateTime());
		return gBuilding;
	}

	public static BuildingDetailVo poToBuildingDetailVo(GBuilding gBuilding) {
		if (gBuilding == null) {
			return null;
		}
		BuildingDetailVo buildingDetailVo = new BuildingDetailVo();
		buildingDetailVo.setBuildingName(gBuilding.getBuildingName());
		buildingDetailVo.setDescription(gBuilding.getDescription());
		buildingDetailVo.setSort(gBuilding.getSort());
		buildingDetailVo.setCustomSort(gBuilding.getCustomSort());
		buildingDetailVo.setClassificationId(gBuilding.getClassificationId());
		buildingDetailVo.setBeltEntrancesCount(gBuilding.getBeltEntrancesCount());
		buildingDetailVo.setPipeInletsCount(gBuilding.getPipeInletsCount());
		buildingDetailVo.setBeltOutletsCount(gBuilding.getBeltOutletsCount());
		buildingDetailVo.setPipeOutletsCount(gBuilding.getPipeOutletsCount());
		buildingDetailVo.setPipeHoleCount(gBuilding.getPipeHoleCount());
		buildingDetailVo.setProductive(gBuilding.getProductive());
		buildingDetailVo.setNeedPower(gBuilding.getNeedPower());
		buildingDetailVo.setPower(gBuilding.getPower());
		buildingDetailVo.setOverclockable(gBuilding.getOverclockable());
		buildingDetailVo.setIsVehicle(gBuilding.getIsVehicle());
		buildingDetailVo.setIsRequireLandform(gBuilding.getIsRequireLandform());
		buildingDetailVo.setImage(gBuilding.getImage());
		buildingDetailVo.setId(gBuilding.getId());
		buildingDetailVo.setOperator(gBuilding.getOperator());
		buildingDetailVo.setCreateTime(gBuilding.getCreateTime());
		buildingDetailVo.setUpdateTime(gBuilding.getUpdateTime());
		return buildingDetailVo;
	}
}
